import Http from '../http';

export function saveChargeStrategyApi(data:any) {
    return Http.post('chargeStrategy/save', data)
}

export async function getChargeStrategyByIdApi(strategyId:number) {
    let res = await Http.get('chargeStrategy/' + strategyId)
    return res.data
}

export async function chargeStrategyPaginationApi(params:{[key:string]:any}) {
    let res = await Http.get('chargeStrategy/page', params)
    return res.data
}

export async function deleteChargeStrategy(strategyId:number|number[]) {
    let res = await Http.delete('chargeStrategy/delete', { id : strategyId })
    return res.success
}

export async function strategyListApi() :Promise<Strategy[]>{
    let { data }= await Http.get('chargeStrategy/strategyList')

    return data
}